package cn.i7baozh.starter.gateway.constant;

import java.util.UUID;

/**
 * 一些常量
 * @author : baoqi.zhang
 * @date :   2022/5/20 11:14
 */
public class GatewayConstants {

    /**
     * client模块
     */
    public static final String MODULE_STARTER_CLIENT = "starter-client";

    /**
     * service模块
     */
    public static final String MODULE_STARTER_SERVICE = "starter-service";

    /**
     * 服务注册到nacos中metadata中服务分组key
     */
    public static final String SELECT_GROUP_HEADER = "i7baozh_group";

    /**
     * 统一日志标识
     *  console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{_traceId_}] %-5level %logger{50}  - %msg%n'
     */
    public static final String DISTRIBUTE_LOGGING_FLAG = "_traceId_";

    public static String getUuid() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }
}
